﻿#ifndef _cac_tcp_server_220507
#define  _cac_tcp_server_220507
//#include <memory>
#include "SL_tcpServer.h"
#include "SL_asynFramePub.h"

//命令级联工作session
class CCacTcpServer : public SLTcpServerCB
{
public:
	static  CCacTcpServer* getInst();

	int init(int port = 0);

	virtual void TcpServer_onConnect(SLTcpClientPtr& _client);
	virtual void TcpServer_onError() {}
	void recvTcpMsgCB(uint32_t _dstID, int msgid, uint32_t _srcID,
                    SLF_sendMemBasePtr& _data,const SLF_senderPtr& _senderPtr,SLF_SessionBasePtr &_in_out_sessSptr);

	SLTcpServerStpr m_tcpserver;
	SLF_senderPtr  getProxyCfgSender(const std::string& _rip, uint16_t _rport, bool reuse = true);	
};

typedef std::shared_ptr< CCacTcpServer>  CCacTcpServerSptr;

#endif //_cac_tcp_server_220507